package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024-09-19
 * Time: 16:18
 */
class MyThread5 extends Thread{
    @Override
    public void run() {
        System.out.println(this.getId() + "," + this.getName());
    }
}
public class ThreadDemon16 {
    public static void main(String[] args) throws InterruptedException {
        /*
        * t1,t2 的先后顺序是不确定的，线程的随机调度*/
        Thread t1 = new MyThread5();
        Thread t2 = new MyThread5();
        t1.start();
        t2.start();
        Thread.sleep(1000);

        System.out.println(t1.getId() + t1.getName());
        System.out.println(t2.getId() + t2.getName());

    }

}
